<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
    <th:block th:include="include :: header('试用期变动历史')"/>
    <th:block th:include="include :: layout-latest-css"/>
    <th:block th:include="include :: ztree-css"/>
    <th:block th:include="include :: select2-css"/>
</head>
<body class="gray-bg">
<div class="modal inmodal fade" id="myModal1" tabindex="-1" role="dialog" aria-hidden="true">
    <div class="modal-dialog modal-sm">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">&times;</span><span
                        class="sr-only">Close</span>
                </button>
                <h4 class="modal-title">试用期变动历史</h4>
            </div>
            <div class="modal-body">
                <p>
                    变动日期从:
                <div class="input-group date">
                    <span class="input-group-addon"><i class="fa fa-calendar"></i></span>
                    <input type="text" id="BeginDate" class="form-control laydate-demo-2" placeholder="yyyy-MM-dd">
                </div>
                </p>
                <p>
                    变动日期到:
                <div class="input-group date">
                    <span class="input-group-addon"><i class="fa fa-calendar"></i></span>
                    <input type="text" id="EndDate" class="form-control laydate-demo-1" placeholder="yyyy-MM-dd">
                </div>
                </p>
            </div>
            <div class="modal-footer">
                <button type="button" class="btn btn-white" id="close" data-dismiss="modal">关闭</button>
                <button type="button" class="btn btn-primary" onclick="queryData()">确定</button>
            </div>
        </div>
    </div>
</div>



<div class="ui-layout-center">
    <div class="container-div">
        <div class="row">
            <div class="col-sm-12 search-collapse">
                <form id="user-form">
                    <div class="select-list">
                        <ul>
                            <li>
                                姓名：<input type="text" name="name"/>
                            </li>
                            <li>
                                工号：<input type="text" name="badge"/>
                            </li>
                            <li>
                                <a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i
                                        class="fa fa-search"></i>&nbsp;搜索</a>
                                <a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i
                                        class="fa fa-refresh"></i>&nbsp;重置</a>
                            </li>
                        </ul>
                    </div>
                </form>
            </div>

            <div class="btn-group-sm" id="toolbar" role="group">

            </div>

            <div class="col-sm-12 select-table table-striped">
                <table id="bootstrap-table"></table>
            </div>
        </div>
    </div>
</div>

<th:block th:include="include :: footer"/>
<th:block th:include="include :: layout-latest-js"/>
<th:block th:include="include :: ztree-js"/>
<th:block th:include="include :: datetimepicker-js"/>


<script th:inline="javascript">
    var prefix = ctx + "changeManage/TrialChange";
    $(function () {
        $("#myModal1").modal('show');

        $(".datetimepicker-demo-2").datetimepicker({
            format: "yyyy-mm-dd",
            minView: "month",
            autoclose: true
        });
        layui.use('laydate', function () {
            var laydate = layui.laydate;
            laydate.render({
                elem: '.laydate-demo-2',
                type: 'date'
            });

        });
        $(".datetimepicker-demo-1").datetimepicker({
            format: "yyyy-mm-dd",
            minView: "month",
            autoclose: true
        });
        layui.use('laydate', function () {
            var laydate = layui.laydate;
            laydate.render({
                elem: '.laydate-demo-1',
                type: 'date'
            });
        });



        var panehHidden = false;
        if ($(this).width() < 800) {
            panehHidden = true;
        }
        $('body').layout({initClosed: panehHidden, west__size: 350});
    });

    function queryData() {
        var beginDate = $("#BeginDate").val();
        var endDate = $("#EndDate").val();
        $("#close").click();
        var columns = [];
        var id = {field: 'id', title: '序号'};
        var badge = {field: 'badge', title: '工号'};
        var name = {field: 'name', title: '姓名'};
        var compName = {field: 'compName', title: '公司名称'};
        var depName = {field: 'depName', title: '部门名称'};
        var jobName = {field: 'jobName', title: '工作岗位'};
        var JoinDate = {field: 'JoinDate', title: '入职日期'};
        var ProbBeginDate = {field: 'ProbBeginDate', title: '试用开始日期'};
        var Probterm = {field: 'Probterm', title: '试用期(月)'};
        var ProbEndDate = {field: 'ProbEndDate', title: '试用结束日期'};
        var NewProbBeginDate = {field: 'NewProbBeginDate', title: '新试用开始日期'};
        var NewProbterm = {field: 'NewProbterm', title: '新试用期(月)'};
        var NewProbEnddate = {field: 'NewProbEnddate', title: '新试用结束日期'};
        var Effectdate = {field: 'Effectdate', title: '生效日期'};
        var remark = {field: 'remark', title: '备注'};

        columns.push(id,badge,name,compName,depName,jobName,JoinDate,ProbBeginDate,Probterm,ProbEndDate);
        columns.push(NewProbBeginDate,NewProbterm,NewProbEnddate,Effectdate,remark);

        var options = {
            code: "id",
            uniqueId: "id",
            url: prefix + "/historyList?beginDate=" + beginDate + "&endDate=" + endDate,
            createUrl: prefix + "/add",
            updateUrl: prefix + "/edit/{id}",
            removeUrl: prefix + "/remove",
            detailUrl: prefix + "/detail/{id}",
            escape: true,
            showPageGo: true,
            rememberSelected: true,
            height: $(window).height() - 120,
            sortOrder: "desc",
            modalName: "试用期变动历史",
            columns: columns
        };
        $.table.init(options);
    }



</script>
</body>
</html>